﻿using B.S.Medical.Api.Write.Application.Command.DoctorSchedule;
using B.S.Medical.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Medical.Api.Write.Controllers.DoctorSchedule
{
    /// <summary>
    /// 医生排班控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class DoctorScheduleController : ControllerBase
    {
        private readonly IMediator mediator;

        public DoctorScheduleController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 新增/修改医生排班
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult<bool>> SetDoctorDaySchedule([FromBody] SetDoctorDayScheduleCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
